Add transformSource hook for counterfactual catalog queries - #95
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A consumer that needs to answer "what would the resolved catalog look like without this configuration layer?" has no way to ask it. The Posit Assistant monorepo's Bedrock disconnect flow needs exactly this: when environment variables or admin configuration would keep a provider connected after the user's own settings are cleared, the clear action must say so — but answering meant re-implementing source precedence by hand, which drifts from the real loader.
loadProviderCatalogReportnow accepts an optionaltransformSourcehook that is applied to every loaded source (file, environment fragments, legacy settings) before resolution. A counterfactual query reuses the exact source options of the live load — same paths, environment variables, and legacy channels — and simply rewrites the sources in flight.The hook is load-path only; watch paths never apply it. This PR also updates the memory-bank guidance on
BEDROCK_DEFAULTS: credential synthesis in the monorepo no longer applies the implicitus-east-1fallback (synthesis is now gated on catalog auth readiness, which requires deliberate region configuration), and adding Bedrock to the defaults map would now make every install fetch Bedrock models.Consumed by the assistant monorepo's AWS sign-in branch (https://github.com/posit-dev/assistant/pull/2243), which uses the hook for its clear-confirmation counterfactual.